package utils;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

/**
 * Created with IntelliJ IDEA.
 * User: kvasolka
 * Date: 6/5/14
 * Time: 8:50 PM
 * To change this template use File | Settings | File Templates.
 */
public class DriverFactory {
    public static final String CHROME = "chrome";
    public static final String FIREFOX = "firefox";

    public static DriverWrapper initDriver(String browser) {
        WebDriver driver = null;
        if (browser.equals(FIREFOX)) {
            driver = new FirefoxDriver();
        }   else if (browser.equals(CHROME)) {
            driver = new ChromeDriver();
        }
        DriverWrapper testDriver = new DriverWrapper(driver);
        return testDriver;
    }
}
